import React, { lazy } from 'react'
import { RouteObject, Navigate } from 'react-router-dom'
const Discover = lazy(() => import('@/views/discover'))
const Album = lazy(() => import('@/views/discover/c-views/album'))
const Artists = lazy(() => import('@/views/discover/c-views/artists'))
const Djradio = lazy(() => import('@/views/discover/c-views/djradio'))
const Rank = lazy(() => import('@/views/discover/c-views/rank'))
const Recommend = lazy(() => import('@/views/discover/c-views/recommend'))
const Songs = lazy(() => import('@/views/discover/c-views/songs'))

const Focus = lazy(() => import('@/views/focus'))
const Mine = lazy(() => import('@/views/mine'))
const Download = lazy(() => import('@/views/download'))

const routes: RouteObject[] = [
    {
        path: '/',
        element: <Navigate to="/discover"></Navigate>
    },
    {
        path: '/discover',
        element: <Discover></Discover>,
        children: [
            {
                path: '/discover',
                element: <Navigate to="/discover/recommend"></Navigate>
            },
            {
                path: '/discover/recommend',
                element: <Recommend></Recommend>
            },
            {
                path: '/discover/rank',
                element: <Rank></Rank>
            },
            {
                path: '/discover/songs',
                element: <Songs></Songs>
            },
            {
                path: '/discover/djradio',
                element: <Djradio></Djradio>
            },
            {
                path: '/discover/artists',
                element: <Artists></Artists>
            },
            {
                path: '/discover/album',
                element: <Album></Album>
            }
        ]
    },
    {
        path: '/download',
        element: <Download></Download>
    },
    {
        path: '/focus',
        element: <Focus></Focus>
    },
    {
        path: '/mine',
        element: <Mine></Mine>
    }
]

export default routes
